package com.asset.salesforce.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.asset.salesforce.dao.ViewDaoImpl;
import com.asset.salesforce.domain.View;

@Service
@Transactional(readOnly = true)
public class ViewService {
	@Autowired
	private ViewDaoImpl viewDao;
	
	public List<View> getViews(Integer ownerId ) {
		return viewDao.getView(ownerId);
	}
	@Transactional(readOnly = false)
	public void addView(View view){
		viewDao.addView(view);
	}
	public View getViewById(Integer Id ) {
		return viewDao.getViewById(Id);
	}
	@Transactional(readOnly = false)
	public void saveOrupdate(View view){
		viewDao.saveOrupdate(view);
	}
	public View loadView(Integer id) {
		return viewDao.loadView(id);
	}
	@Transactional(readOnly = false)
	public void deleteView(View view) {
		viewDao.deleteView(view);
	}
}
